const app = getApp()

Page({
  data: {
    img:[],
    path:null,
    imagePath:''
  },

  onShow() {
    this.getTabBar().init();
  },

  onLoad: function () {
    console.log(app.globalData)
    const db = wx.cloud.database()
    db.collection('imgFile').get().then(res => {
      console.log(res.data)
      let arr =[]
      res.data.map(item=>{
        arr.push(item.fileID)
      })
      console.log(arr)
      wx.cloud.getTempFileURL({
        fileList:arr
      }).then(res=>{
        console.log(res,'////////////////////')
        this.setData({
          img: res.fileList
        })
      }).catch(error=>{
        console.log(error,'错误')
      })
      // const { 
      //   imagePath,
      // } = app.globalData
      // this.setData({
      //   imagePath,
      //   path:res.data
      // })
    })
  },
})